package com.suredy.app.project.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.suredy.app.project.constants.ContractLevel;
import com.suredy.core.model.BaseModel;

/**
 * 合同成员（甲、乙、丙、丁）
 * 
 * @author VIVID.G
 * @since 2015-7-30
 * @version v0.1
 */
@Entity
@Table(name = "tb_contract_member")
public class ContractMember extends BaseModel {

	private static final long serialVersionUID = 1L;

	/* 级别 */
	@Column(nullable = false)
	@Enumerated(EnumType.ORDINAL)
	private ContractLevel level;

	/* 公司名称 */
	@Column(length = 200, nullable = false)
	private String company;

	/* 联系人 */
	@Column(length = 30)
	private String people;

	/* 电话 */
	@Column(length = 20)
	private String phone;

	/* 合同 */
	@ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
	@JoinColumn(name = "contract_id")
	private Contract contract;

	public ContractLevel getLevel() {
		return level;
	}

	public void setLevel(ContractLevel level) {
		this.level = level;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getPeople() {
		return people;
	}

	public void setPeople(String people) {
		this.people = people;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Contract getContract() {
		return contract;
	}

	public void setContract(Contract contract) {
		this.contract = contract;
	}

}
